# Docker 镜像构建

FROM maven:3.6.3-jdk-8-slim as builder


# 解决容器时期与真实时间相差 8 小时的问题
RUN ln -snf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo Asia/Shanghai > /etc/timezone

COPY settings.xml /usr/share/maven/conf/settings.xml
# Copy local code to the container image.
WORKDIR /app
COPY pom.xml .
COPY src ./src

# Build a release artifact.
RUN mvn package -DskipTests

# Run the web service on container startup.
CMD ["java","-jar","/app/target/aimian-backend-0.0.1-SNAPSHOT.jar","--spring.profiles.active=prod"]
